//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.tencent.bugly.crashreport.crash;

import android.content.Context;

import com.tencent.bugly.crashreport.common.strategy.a;
import com.tencent.bugly.proguard.w;
import com.tencent.bugly.proguard.x;

import java.util.Map;

public final class d {
    private static d a = null;
    private a b;
    private com.tencent.bugly.crashreport.common.info.a c;
    private b d;
    private Context e;

    private d(Context var1) {
        c var2;
        if ((var2 = com.tencent.bugly.crashreport.crash.c.a()) != null) {
            this.b = com.tencent.bugly.crashreport.common.strategy.a.a();
            this.c = com.tencent.bugly.crashreport.common.info.a.a(var1);
            this.d = var2.p;
            this.e = var1;
            w.a().a(new Runnable() {
                public final void run() {
                    a(d.this);
                }
            });
        }
    }

    static /* synthetic */ void a(d dVar) {
        x.c("[ExtraCrashManager] Trying to notify Bugly agents.");
        try {
            Class cls = Class.forName("com.tencent.bugly.agent.GameAgent");
            String obj = "com.tencent.bugly";
            com.tencent.bugly.proguard.z.a(cls, "sdkPackageName", obj, null);
            x.c("[ExtraCrashManager] Bugly game agent has been notified.");
        } catch (Throwable th) {
            x.a("[ExtraCrashManager] no game agent");
        }
    }

    public static d a(Context var0) {
        if (a == null) {
            a = new d(var0);
        }

        return a;
    }

    public static void a(final Thread var0, final int var1, final String var2, final String var3, final String var4, final Map<String, String> var5) {
        w.a().a(new Runnable() {
            public final void run() {
                try {
                    if (com.tencent.bugly.crashreport.crash.d.a == null) {
                        x.e("[ExtraCrashManager] Extra crash manager has not been initialized.", new Object[0]);
                    } else {
                        com.tencent.bugly.crashreport.crash.d.a(com.tencent.bugly.crashreport.crash.d.a, var0, var1, var2, var3, var4, var5);
                    }
                } catch (Throwable var2x) {
                    if (!x.b(var2x)) {
                        var2x.printStackTrace();
                    }

                    x.e("[ExtraCrashManager] Crash error %s %s %s", new Object[]{var2, var3, var4});
                }
            }
        });
    }
}
